#version 410 core

in DATA
{
    vec4 color;
    vec2 uv;
    float texture_unit;
} fs_in;

out vec4 FragColor;
uniform sampler2D tex[16];

void main()
{
    if (fs_in.texture_unit < 0)
    {
        FragColor = fs_in.color;
    }
    else
    {
        int tid = int(fs_in.texture_unit);
        FragColor = texture(tex[tid], fs_in.uv);
        // FragColor = vec4(0.6, 0.2, 0.1, 1.0);
    }
}
